
objs = a.o b.o c.o

CFLAGS = -Werror

dep_files := $(patsubst %, .%.d, $(objs))
dep_files := $(wildcard $(dep_files))

test:$(objs)
	gcc -o test $^
	@echo  files = $(dep_files)

ifneq ($(dep_files), )
include $(dep_files)
endif

%.o : %.c
	gcc $(CFLAGS) -c -o $@ $< -MD -MF .$@.d

clean:
	rm -rf test
	rm -rf *.o

distclean:
	rm $(dep_files)

.PHONY: clean
